from django.db import models
from django.utils import timezone
import datetime

# Create your models here.

class UserModel(models.Model):
    username = models.CharField(max_length=30,verbose_name='用户名')
    phone = models.CharField(max_length=11,verbose_name='手机号')
    password = models.CharField(max_length=256,verbose_name='密码')
    created_time = models.DateTimeField(verbose_name='注册时间',default=timezone.now)
    last_login = models.DateTimeField(verbose_name='最后登录时间',default=timezone.now)
    is_staff = models.BooleanField(verbose_name='是否是管理员', default=False)
    is_cativated = models.BooleanField(verbose_name='是否激活管理员权限', default=True)


    class Meta:
        verbose_name = '用户表'
        verbose_name_plural = verbose_name
        db_table = 'users'

    def __str__(self):
        return self.username











